<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>PID plotter component: /home/vedant/Programming/projects/pid-tuning-gui/esp_codes/components/pid_plotter/include/transport.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">PID plotter component
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">ESP-IDF component for pid plotter</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">transport.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="transport_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef TRANSPORT_H</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define TRANSPORT_H</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;</div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &lt;stdlib.h&gt;</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="udp__handler_8h.html">udp_handler.h</a>&quot;</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="json__handler_8h.html">json_handler.h</a>&quot;</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="tcp__handler_8h.html">tcp_handler.h</a>&quot;</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#include &quot;logger.h&quot;</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#include &quot;freertos/FreeRTOS.h&quot;</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#include &quot;freertos/task.h&quot;</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &quot;esp_system.h&quot;</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &quot;freertos/queue.h&quot;</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &quot;freertos/event_groups.h&quot;</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &quot;freertos/semphr.h&quot;</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &quot;esp_err.h&quot;</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#include &quot;protocol_examples_common.h&quot;</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;</div><div class="line"><a name="l00018"></a><span class="lineno"><a class="line" href="transport_8h.html#afd5531c3e8b14bff72ce2bb5d9e37afb">   18</a></span>&#160;TaskHandle_t <a class="code" href="transport_8h.html#afd5531c3e8b14bff72ce2bb5d9e37afb">pid_transport_handle</a>, <a class="code" href="transport_8h.html#af69ee3a89d006744edbe8e3039c6210d">pid_const_transport_handle</a>;</div><div class="line"><a name="l00019"></a><span class="lineno"><a class="line" href="transport_8h.html#a3b6a15c259cc8b4aff104b1ace175fc9">   19</a></span>&#160;QueueHandle_t <a class="code" href="transport_8h.html#a3b6a15c259cc8b4aff104b1ace175fc9">pid_struct_queue</a>;</div><div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="transport_8h.html#a4e23be7e0ba011a32f7896896aaf186e">   20</a></span>&#160;SemaphoreHandle_t <a class="code" href="transport_8h.html#a4e23be7e0ba011a32f7896896aaf186e">pid_const_read_write_mutex</a>;</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="transport_8h.html#a81a6fc89c7bc286cb7360b155b1901bf">   22</a></span>&#160;<span class="preprocessor">#define MESSAGE_QUEUE_SIZE CONFIG_MESSAGE_QUEUE_SIZE </span></div><div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="structpid__terms.html">   23</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structpid__terms.html">pid_terms</a></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;{</div><div class="line"><a name="l00025"></a><span class="lineno"><a class="line" href="structpid__terms.html#ab4c7f8712a43d4fe1b8932783f286c22">   25</a></span>&#160;    <span class="keywordtype">float</span> <a class="code" href="structpid__terms.html#ab4c7f8712a43d4fe1b8932783f286c22">current</a>;</div><div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="structpid__terms.html#a8073092d43a680432fa0f7784a7aef29">   26</a></span>&#160;    <span class="keywordtype">float</span> <a class="code" href="structpid__terms.html#a8073092d43a680432fa0f7784a7aef29">error</a>;</div><div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="structpid__terms.html#af930983320efcf1d96d3b7cb85fee908">   27</a></span>&#160;    <span class="keywordtype">float</span> <a class="code" href="structpid__terms.html#af930983320efcf1d96d3b7cb85fee908">P</a>;</div><div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="structpid__terms.html#af72ae69eaa9faeab7273dcbd847fdee9">   28</a></span>&#160;    <span class="keywordtype">float</span> <a class="code" href="structpid__terms.html#af72ae69eaa9faeab7273dcbd847fdee9">I</a>;</div><div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="structpid__terms.html#a864b7035292cd484f321d0f52a5a68d8">   29</a></span>&#160;    <span class="keywordtype">float</span> <a class="code" href="structpid__terms.html#a864b7035292cd484f321d0f52a5a68d8">D</a>;</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;};</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;</div><div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="structdata__recv.html">   32</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structdata__recv.html">data_recv</a></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;{</div><div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="structdata__recv.html#af60b2e3d44df4ef57e1998ff55783920">   34</a></span>&#160;    <span class="keyword">struct </span><a class="code" href="structpid__terms.html">pid_terms</a> data;</div><div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="structdata__recv.html#a96d1938d8172e27035f655727f675273">   35</a></span>&#160;    esp_err_t <a class="code" href="structdata__recv.html#a96d1938d8172e27035f655727f675273">err</a>;</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;};</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;</div><div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="transport_8h.html#a73103b87c83e2ad74f75c8e400f58376">   38</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structpid__const.html">pid_const</a> <a class="code" href="transport_8h.html#a73103b87c83e2ad74f75c8e400f58376">pid_const_data</a>;</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;esp_err_t <a class="code" href="transport_8h.html#a320afeaba56579760e7e3185a3d1fa02">init_queue</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="keywordtype">void</span> <a class="code" href="transport_8h.html#a6afdab1f1ab02c6ed620949a7d32ffa4">init_transport</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;esp_err_t <a class="code" href="transport_8h.html#a3d23daa4cae5ba60d838c8a2b785462e">send_to_queue</a>(<span class="keyword">struct</span> <a class="code" href="structpid__terms.html">pid_terms</a> pid_data);</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="keyword">struct </span><a class="code" href="structdata__recv.html">data_recv</a> <a class="code" href="transport_8h.html#a3f717da7b4c254e710bbfd76625b15e4">receive_from_queue</a>(void);</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="keywordtype">void</span> <a class="code" href="transport_8h.html#a56e72500cb37fcbc087c3c3125ab7f8e">pid_transport</a>();</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="keywordtype">void</span> <a class="code" href="transport_8h.html#acaba133d8c5e0cbadc4cfff68feca9fc">pid_const_transport</a>();</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="keyword">struct </span><a class="code" href="structpid__const.html">pid_const</a> <a class="code" href="transport_8h.html#aa37b5765ca807a54890c516c916e7e9b">pid_const_read</a>();</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="preprocessor">#endif</span></div><div class="ttc" id="structpid__terms_html_a8073092d43a680432fa0f7784a7aef29"><div class="ttname"><a href="structpid__terms.html#a8073092d43a680432fa0f7784a7aef29">pid_terms::error</a></div><div class="ttdeci">float error</div><div class="ttdef"><b>Definition:</b> transport.h:26</div></div>
<div class="ttc" id="udp__handler_8h_html"><div class="ttname"><a href="udp__handler_8h.html">udp_handler.h</a></div></div>
<div class="ttc" id="transport_8h_html_a6afdab1f1ab02c6ed620949a7d32ffa4"><div class="ttname"><a href="transport_8h.html#a6afdab1f1ab02c6ed620949a7d32ffa4">init_transport</a></div><div class="ttdeci">void init_transport(void)</div><div class="ttdoc">Initialises transport, i.e. connect to wifi. </div><div class="ttdef"><b>Definition:</b> transport.c:42</div></div>
<div class="ttc" id="structpid__terms_html_a864b7035292cd484f321d0f52a5a68d8"><div class="ttname"><a href="structpid__terms.html#a864b7035292cd484f321d0f52a5a68d8">pid_terms::D</a></div><div class="ttdeci">float D</div><div class="ttdef"><b>Definition:</b> transport.h:29</div></div>
<div class="ttc" id="transport_8h_html_a4e23be7e0ba011a32f7896896aaf186e"><div class="ttname"><a href="transport_8h.html#a4e23be7e0ba011a32f7896896aaf186e">pid_const_read_write_mutex</a></div><div class="ttdeci">SemaphoreHandle_t pid_const_read_write_mutex</div><div class="ttdef"><b>Definition:</b> transport.h:20</div></div>
<div class="ttc" id="transport_8h_html_acaba133d8c5e0cbadc4cfff68feca9fc"><div class="ttname"><a href="transport_8h.html#acaba133d8c5e0cbadc4cfff68feca9fc">pid_const_transport</a></div><div class="ttdeci">void pid_const_transport()</div><div class="ttdoc">Handles TCP client, which receives pid_constants from server, and parses the data and stores it in a ...</div><div class="ttdef"><b>Definition:</b> transport.c:151</div></div>
<div class="ttc" id="structpid__terms_html"><div class="ttname"><a href="structpid__terms.html">pid_terms</a></div><div class="ttdef"><b>Definition:</b> transport.h:23</div></div>
<div class="ttc" id="structpid__terms_html_af930983320efcf1d96d3b7cb85fee908"><div class="ttname"><a href="structpid__terms.html#af930983320efcf1d96d3b7cb85fee908">pid_terms::P</a></div><div class="ttdeci">float P</div><div class="ttdef"><b>Definition:</b> transport.h:27</div></div>
<div class="ttc" id="transport_8h_html_a3b6a15c259cc8b4aff104b1ace175fc9"><div class="ttname"><a href="transport_8h.html#a3b6a15c259cc8b4aff104b1ace175fc9">pid_struct_queue</a></div><div class="ttdeci">QueueHandle_t pid_struct_queue</div><div class="ttdef"><b>Definition:</b> transport.h:19</div></div>
<div class="ttc" id="structpid__const_html"><div class="ttname"><a href="structpid__const.html">pid_const</a></div><div class="ttdef"><b>Definition:</b> json_handler.h:30</div></div>
<div class="ttc" id="transport_8h_html_afd5531c3e8b14bff72ce2bb5d9e37afb"><div class="ttname"><a href="transport_8h.html#afd5531c3e8b14bff72ce2bb5d9e37afb">pid_transport_handle</a></div><div class="ttdeci">TaskHandle_t pid_transport_handle</div><div class="ttdef"><b>Definition:</b> transport.h:18</div></div>
<div class="ttc" id="tcp__handler_8h_html"><div class="ttname"><a href="tcp__handler_8h.html">tcp_handler.h</a></div></div>
<div class="ttc" id="structpid__terms_html_af72ae69eaa9faeab7273dcbd847fdee9"><div class="ttname"><a href="structpid__terms.html#af72ae69eaa9faeab7273dcbd847fdee9">pid_terms::I</a></div><div class="ttdeci">float I</div><div class="ttdef"><b>Definition:</b> transport.h:28</div></div>
<div class="ttc" id="transport_8h_html_aa37b5765ca807a54890c516c916e7e9b"><div class="ttname"><a href="transport_8h.html#aa37b5765ca807a54890c516c916e7e9b">pid_const_read</a></div><div class="ttdeci">struct pid_const pid_const_read()</div><div class="ttdoc">Returns pid_const_data struct. Checks if the resource is blocked by mutex for writing or it is access...</div><div class="ttdef"><b>Definition:</b> transport.c:209</div></div>
<div class="ttc" id="json__handler_8h_html"><div class="ttname"><a href="json__handler_8h.html">json_handler.h</a></div></div>
<div class="ttc" id="structpid__terms_html_ab4c7f8712a43d4fe1b8932783f286c22"><div class="ttname"><a href="structpid__terms.html#ab4c7f8712a43d4fe1b8932783f286c22">pid_terms::current</a></div><div class="ttdeci">float current</div><div class="ttdef"><b>Definition:</b> transport.h:25</div></div>
<div class="ttc" id="transport_8h_html_a56e72500cb37fcbc087c3c3125ab7f8e"><div class="ttname"><a href="transport_8h.html#a56e72500cb37fcbc087c3c3125ab7f8e">pid_transport</a></div><div class="ttdeci">void pid_transport()</div><div class="ttdoc">Handles UDP client, which sends pid_terms received through message queue. </div><div class="ttdef"><b>Definition:</b> transport.c:113</div></div>
<div class="ttc" id="structdata__recv_html_a96d1938d8172e27035f655727f675273"><div class="ttname"><a href="structdata__recv.html#a96d1938d8172e27035f655727f675273">data_recv::err</a></div><div class="ttdeci">esp_err_t err</div><div class="ttdef"><b>Definition:</b> transport.h:35</div></div>
<div class="ttc" id="transport_8h_html_a73103b87c83e2ad74f75c8e400f58376"><div class="ttname"><a href="transport_8h.html#a73103b87c83e2ad74f75c8e400f58376">pid_const_data</a></div><div class="ttdeci">struct pid_const pid_const_data</div><div class="ttdef"><b>Definition:</b> transport.h:38</div></div>
<div class="ttc" id="structdata__recv_html"><div class="ttname"><a href="structdata__recv.html">data_recv</a></div><div class="ttdef"><b>Definition:</b> transport.h:32</div></div>
<div class="ttc" id="transport_8h_html_a3f717da7b4c254e710bbfd76625b15e4"><div class="ttname"><a href="transport_8h.html#a3f717da7b4c254e710bbfd76625b15e4">receive_from_queue</a></div><div class="ttdeci">struct data_recv receive_from_queue(void)</div><div class="ttdoc">Receive data from queue. </div><div class="ttdef"><b>Definition:</b> transport.c:83</div></div>
<div class="ttc" id="transport_8h_html_af69ee3a89d006744edbe8e3039c6210d"><div class="ttname"><a href="transport_8h.html#af69ee3a89d006744edbe8e3039c6210d">pid_const_transport_handle</a></div><div class="ttdeci">TaskHandle_t pid_const_transport_handle</div><div class="ttdef"><b>Definition:</b> transport.h:18</div></div>
<div class="ttc" id="transport_8h_html_a3d23daa4cae5ba60d838c8a2b785462e"><div class="ttname"><a href="transport_8h.html#a3d23daa4cae5ba60d838c8a2b785462e">send_to_queue</a></div><div class="ttdeci">esp_err_t send_to_queue(struct pid_terms pid_data)</div><div class="ttdoc">Sends pid_data struct to message queue. </div><div class="ttdef"><b>Definition:</b> transport.c:57</div></div>
<div class="ttc" id="transport_8h_html_a320afeaba56579760e7e3185a3d1fa02"><div class="ttname"><a href="transport_8h.html#a320afeaba56579760e7e3185a3d1fa02">init_queue</a></div><div class="ttdeci">esp_err_t init_queue(void)</div><div class="ttdoc">Initialises message queue. </div><div class="ttdef"><b>Definition:</b> transport.c:10</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
